package view;

import controller.Controller;
import controller.ActionLis;

import javax.swing.*;

public class LoginJFrame extends JFrame {
    public static LoginJPanel loginJPanel;
    private Controller controller;
    public JMenuBar jMenuBar;
    public JMenu jMenu;
    public  JMenuItem register;
    public ActionLis actionLis=new ActionLis();
    public LoginJFrame(Controller controller){
        this.controller=controller;
        setTitle("欢乐斗地主登录界面");
        //设置不能拖动
        setResizable(false);
        //设置关闭后退出
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        //将面板添加到界面中
        loginJPanel = new LoginJPanel(controller);
        add(loginJPanel);
        //添加菜单
         jMenuBar = new JMenuBar();
        jMenu = new JMenu("操作");
        jMenuBar.add(jMenu);
         register = new JMenuItem("注册");
        jMenu.add(register);
        setJMenuBar(jMenuBar);
        register.addActionListener(actionLis);
        register.setActionCommand("goRegister");


        //设置默认居中
        pack();
        setLocationRelativeTo(null);

    }
}
